package com.yc.cloud.portal.dto.resp;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@NoArgsConstructor
@Data
public class GPTResp {

    @JsonProperty("role")
    private String role;
    @JsonProperty("id")
    private String id;
    @JsonProperty("parentMessageId")
    private String parentMessageId;
    @JsonProperty("text")
    private String text;
    @JsonProperty("delta")
    private String delta;
    @JsonProperty("detail")
    private DetailDTO detail;

    @NoArgsConstructor
    @Data
    public static class DetailDTO {
        @JsonProperty("id")
        private String id;
        @JsonProperty("object")
        private String object;
        @JsonProperty("created")
        private Integer created;
        @JsonProperty("model")
        private String model;
        @JsonProperty("system_fingerprint")
        private String systemFingerprint;
        @JsonProperty("choices")
        private List<ChoicesDTO> choices;

        @NoArgsConstructor
        @Data
        public static class ChoicesDTO {
            @JsonProperty("index")
            private Integer index;
            @JsonProperty("delta")
            private DeltaDTO delta;
            @JsonProperty("logprobs")
            private Object logprobs;
            @JsonProperty("finish_reason")
            private Object finishReason;

            @NoArgsConstructor
            @Data
            public static class DeltaDTO {
                @JsonProperty("content")
                private String content;
            }
        }
    }
}
